home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5UTL011.TIP < prev    next >
Text File  |  1993-06-01  |  3KB  |  69 lines

  1. If you use a delayed-write cache such as SmartDrive, batch
  2. files that write to disk then reboot your system don't work.
  3. I discovered this the hard way; luckily, I also discovered a
  4. solution.
  5.  
  6. I boot with different AUTOEXEC.BAT and CONFIG.SYS files,
  7. depending on whether I'm going to run Windows. To make this
  8. easier, I have a batch file, GO.BAT, that swaps my
  9. AUTOEXEC.BAT and CONFIG.SYS files, then reboots the system
  10. using WARMBOOT.COM (see "Batching the Warm Boot," User Group
  11. Tips, July 1992). This worked well until I installed Windows
  12. 3.1, which automatically adds SmartDrive to the system.
  13. Since SmartDrive waits before writing files to disk, my
  14. batch file would reboot the computer before it had copied my
  15. files. The result? My system would reboot with the same
  16. AUTOEXEC.BAT and CONFIG.SYS as before.
  17.  
  18. My solution is to place three lines at the beginning of the
  19. batch file:
  20.  
  21. ---- BEGIN LISTING ----
  22. @ECHO OFF
  23. SMARTDRV  /C
  24. SMARTDRV C
  25. ---- END LISTING ----
  26.  
  27. The second line writes all cached data to disk; the third
  28. turns off write-behind caching for drive C:. This ensures
  29. that the copy command completes its duties before the system
  30. reboots.
  31.  
  32. William H. McWilliams
  33. Uniontown, Pennsylvania
  34.  
  35. Editor's Note: An unflushed cache -- that is, one that holds
  36. data that still needs to be written to the disk -- creates a
  37. very real problem for batch files and programs that
  38. reconfigure and reboot your computer: They often fail to
  39. function as expected and may even leave you without a
  40. CONFIG.SYS or AUTOEXEC.BAT file. This situation crops up on
  41. machines running SmartDrive, Norton's NCACHE, PowerCache
  42. Plus, and other caches that feature delayed writes (also
  43. called write-back or write-behind). It also poses a danger:
  44. If you shut off your PC too soon after performing a file
  45. operation, the results can be lost and the hard disk can be
  46. corrupted. Mr. McWilliams' approach (which I also use on my
  47. system) solves the problem, at least in situations where
  48. software causes the machine to reboot.
  49.  
  50. If you're concerned with shutting off your PC before cached
  51. data has been written to disk, simply place his batch
  52. fragment in a file called SHUTDOWN.BAT and then run the
  53. batch file before you turn your machine off. If you're using
  54. SmartDrive, you can use the Alt-F command to copy Mr.
  55. McWilliams' commands to a file for your own use. Note that
  56. if you're running a cache other than SmartDrive, the
  57. commands needed to flush and disable the cache will be
  58. different, but they almost always consist of the name of the
  59. caching program followed by a command or command switch.
  60. Consult your cache's manual to find the correct command.
  61.  
  62.  
  63. Title: When SmartDrive Gets Too Smart
  64. Category: UTL
  65. Issue Date: November, 1992
  66. Editor: Brett Glass
  67. Supplementary Files: None
  68. Filename: P5UTL011.TIP
  69.